{% extends "opda/base.html" %}

{% block mid %}
    <div class="col-lg-12" style="margin-top: 100px;">
        <div class="panel panel-default">
            <div class="panel-body">
            {% if current_user.user_type == 10 or current_user.super_user %}
            <button class="pull-right btn btn-default" data-toggle="modal" data-target="#add_app_dialog">添加应用</button>
            {% endif %}
                {% if app_mso|length %}
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th class="col-lg-2">name</th>
                                {% if current_user.user_type == 10 or current_user.super_user %}
                                <th class="col-lg-2">user</th>
                                <th class="col-lg-2">manage</th>
                                {% endif %}
                            </tr>
                        </thead>
{#                    请点击选择要管理用户：<br/>#}
                        <tbody>
                        {% for a in app_mso %}
                            <tr>
                                <td><a href="/appactive/{{ a.id }}">{{ a.name }}</a></td>
                                {%  if current_user.user_type == 10 or current_user.super_user %}
                                <td>{{ a.visitor_name() }}</td>
                                <td>
                                    <a>修改</a>
                                    <a>删除</a>
                                </td>
                                {% endif %}
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                {% else %}
                    没有管理的应用
                {% endif %}
            </div>

        </div>
    </div>
    {% include 'opda/block/dialog.html' %}
{% endblock %}
